<?php

namespace app\api\Controller\mall;

use think\Request;
use think\Db;
use app\api\controller\Common;

class CommonMall extends Common
{
    protected $member = null;
    protected $member_relang = null;
    protected $rate = 5;
    protected $db = null;

    public function __construct(Request $request = null) {
        parent::__construct($request);
        $this->member_relang = $this->member;
        if ($this->member && $this->member['id']) {
            $this->db = $this->syncDbConnect();
        }
    }

    public function syncDbConnect()
    {
        $this->member_relang = _channelUser($this->member['id']);
        return Db::connect(getenv('APP_MALL_DATABASE'));
    }
}